<div class="page-content" >
<div class="panel panel-default">
	<div class="panel-heading">
		<ul class="breadcrumb">
			<li><a href="<{:addons_url('wechatMenu')}>">微信菜单管理</a> </li>
			<li class="active">添加/修改微信菜单</li>
		</ul>
	</div>
	<div class="panel-body">
		<form id="myform" method="post" class="form-horizontal"  action="<{:addons_url('wmenuInsert')}>">
			<input type="hidden" name="id" value="<{$list.id}>">
			<if condition="$data.id eq ''">
				<div class="form-group">
					<label for="input-title" class="col-sm-2 control-label">菜单</label>
					<div class="col-sm-7">
						<select name="pid" class="form-control">
							<option value="0">--顶级菜单--</option>
							<volist name="data" id="vo"> <option value="<{$vo.id}>" 
								<if condition="$list.id eq $vo.id ">selected</if>><{$vo.showname}>
								</option>
							</volist>
						</select>
					</div>
					<div class="col-sm-3"></div>
				</div>
			</if>
			<div class="form-group">
				<label for="input-title" class="col-sm-2 control-label">菜单名</label>
				<div class="col-sm-7">
					<input type="text" class="form-control" id="name" name="name" value="<{$list.name}>">
				</div>
				<div class="col-sm-3"></div>
			</div>
			<div class="form-group">
				<label for="input-title" class="col-sm-2 control-label">菜单类型</label>
				<div class="col-sm-7">
					<select name="type">
						<option value="view" 
						<if condition="$list.type eq 'view'">selected="selected"</if>
						>view
						</option>
						<option value="click" 
						<if condition="$list.type eq 'click'">selected="selected"</if>
						>click
						</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="input-title" class="col-sm-2 control-label">链接地址或者素材ID</label>
				<div class="col-sm-7">
					<input type="text" placeholder="（菜单类型为view时，请填写网址，当为click时，请填写素材ID）" style=" width:100%" class="form-control" id="url" name="url" value="<{$list.url}>">
					 </div>
					 <div class="col-sm-3"></div>
			</div>
			<if condition="$list['id']">
				<div class="form-group">
					<label for="input-title" class="col-sm-2 control-label">状态</label>
					<div class="col-sm-7">
						<p class="int_irx_tx2"><input type="radio" name="status" value="0" 
							<if condition="$list.status eq 0">checked="checked"</if>
							/>&nbsp;显示</p>
						<p class="int_irx_tx2"><input type="radio" name="status" value="1" 
							<if condition="$list.status eq 1">checked="checked"</if>
							/>&nbsp;不显示</p>
					</div>
					<div class="col-sm-3"></div>
				</div>
			</if>
			 <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-7">
                        <button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </div>
			<div class="form-group">
			<label for="input-title" class="col-sm-2 control-label"></label>
			<div class="col-sm-7">
			<p>用户点击click类型按钮后，微信服务器会通过消息接口推送消息类型为event,素材ID可以在素材管理获取</p>
			<br />
			<p>用户点击view类型按钮后，微信客户端将会打开开发者在按钮中填写的url值</p>
			</div>
			</div>
		</form>
	</div>
</div>
</div>

<script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            url: {
                message: '链接地址或者素材ID',
                validators: {
                    notEmpty: {
                        message: '链接地址或者素材ID不能为空'
                    },
                }
            },
			 name: {
                message: '菜单名',
                validators: {
                    notEmpty: {
                        message: '菜单名不能为空'
                    },
                }
            },
			 
			  

        }
    });
	
 
});
 </script>
